package com.andy.service.impl;

import com.andy.infrastructure.util.FreeMarkerUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CommonService {

    @Autowired
    private freemarker.template.Configuration cfg;

    @Autowired
    private FreeMarkerUtil freeMarkerUtil;


    public void createDemoString(String input) {
        String ftlName = "demo.ftl";
        String result = freeMarkerUtil.getFreeMarkerString(cfg,ftlName, input);
        System.out.println(result);
    }

    public String toFtlString(String input,String ftlName){
        return freeMarkerUtil.getFreeMarkerString(cfg,ftlName, input);
    }

}
